#pragma once
_Pragma("once")





typedef struct 
{
    float kp;
    float ki;

    float upper;//限幅
    float lower;//限幅

    float y_init;//输出的初始值

    float Ts;//采样时间

    float yi; //积分值
    float y;//输出信号
    //int update;//复位值,非零复位
    

} PI;



// Function declaration
#ifdef __cplusplus
extern "C" {
#endif

extern PI* PI_Creat();

extern void PI_Cal(
    PI *p,
    float x,
    int update,
    float PI_kp,
    float PI_ki,
    float PI_upper,
    float PI_lower,
    float PI_y_init,
    float Ts,
    float *y);

#ifdef __cplusplus
}
#endif




